<template>
  <div class="index">
    <el-container style="height: 920px; border: 1px solid #eee">
      <el-aside width="260px">
        <a href="/index"
          ><img src="../assets/images/itcast.jpg" class="img" alt=""
        /></a>
        <!-- 导航菜单 -->
        <el-col :span="24">
          <el-menu
            :default-active="default_active"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            :unique-opened="true"
            :router="true"
          >
            <!-- row1 -->
            <el-submenu index="1-1">
              <template slot="title">
                <i class="el-icon-user-solid"></i>
                <span>用户管理</span>
              </template>
              <el-menu-item index="1-1">选项1</el-menu-item>
              <el-menu-item index="1-2">选项2</el-menu-item>
              <el-menu-item index="1-3">选项3</el-menu-item>
            </el-submenu>
            <!-- row2 -->
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-user-solid"></i>
                <span>文章管理</span>
              </template>
              <el-menu-item index="/index/articleList"
                ><i class="el-icon-user-solid"></i>文章列表</el-menu-item
              >
              <el-menu-item index="/index/articlePublic"
                ><i class="el-icon-user-solid"></i>文章发布</el-menu-item
              >
            </el-submenu>
            <!-- row3 -->
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-user-solid"></i>
                <span>栏目管理</span>
              </template>
              <el-menu-item index="3-1">选项1</el-menu-item>
              <el-menu-item index="3-2">选项2</el-menu-item>
              <el-menu-item index="3-3">选项3</el-menu-item>
            </el-submenu>
          </el-menu>
        </el-col>
        <!-- 导航菜单 End -->
      </el-aside>
      <el-container>
        <el-header>
          <a href="javascript:;" class="left el-icon-s-fold"></a>
          <div class="title">黑马头条后台管理系统</div>
          <div class="right">欢迎你：肥鹑 <a href="javascript:;">退出</a></div>
        </el-header>
        <!-- 主题内容 -->
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      default_active: "",
    };
  },
  mounted() {
    this.default_active = location.pathname;
  },
};
</script>

// 样式：
<style lang="less" scoped>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  //   text-align: center;
  height: 80px !important;
  line-height: 80px;
  background-color: rgb(84, 92, 100);
}
.el-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  .left {
    font-size: 40px;
    color: white;
    text-decoration: none;
  }
  .title {
    font-size: 24px;
  }
  .right {
    font-size: 16px;
    color: #e0e0e0;
    a {
      color: #aaa;
    }
  }
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  //   line-height: 200px;
  background-color: rgb(84, 92, 100);
}

.el-main {
  //   background-color: #e9eef3;
  background-color: white;
  color: #333;
  text-align: center;
  line-height: 160px;
}
/deep/.el-submenu__title {
  padding-left: 0 !important;
}
.img {
  height: 80px;
  width: 100%;
  //   visibility: hidden;
}
</style>